import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;

public class wfile {
	public static void main(String[] args) throws Exception {
		File file = new File("c://vbs");

		File[] listFiles = file.listFiles();
		StringBuilder sb = new StringBuilder();
		for (File file2 : listFiles) {
			sb.setLength(0);

			FileInputStream fis = new FileInputStream(file2);

			InputStreamReader isr = new InputStreamReader(fis, "utf-8");

			BufferedReader br = new BufferedReader(isr);

			String tmp = null;

			while ((tmp = br.readLine()) != null) {
				if (tmp.contains("6FB8Hn85u6ZbBaYD")) {				
					sb.append(tmp).append(System.lineSeparator());
					sb.append("crt.Screen.WaitForString \"root\"").append(System.lineSeparator());
				} else {
					sb.append(tmp).append(System.lineSeparator());
				}
			}
			br.close();

			FileOutputStream fos = new FileOutputStream(file2);

			OutputStreamWriter osw = new OutputStreamWriter(fos, "utf-8");
			BufferedWriter bw = new BufferedWriter(osw);
			bw.write(sb.toString());
			bw.close();
		}

	}
}
